<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>用户添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>
<body>
	<div class="x-nav">
		<span class="layui-breadcrumb"> <a><cite>首页</cite></a> <a><cite>用户管理</cite></a>
			<a><cite>修改用户信息</cite></a>
		</span> <a class="layui-btn layui-btn-small"
			style="line-height: 1.6em; margin-top: 3px; float: right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="layui-icon" style="line-height: 30px">ဂ</i></a>
	</div>
	<div class="x-body">
		<form class="layui-form layui-form-pane" action="" id="upd">
			<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<!--<form class="layui-form layui-form-pane" action="" id="add">-->
						<input type="hidden" name="id" value="{$art.id}">
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>用户编号
							</label>
							<div class="layui-input-block">
								<input type="text" name="userNo" autocomplete="off" value="<%=request.getParameter("userNo")%>"
									class="layui-input" id="userNo" readonly>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>员工编号
							</label>
							<div class="layui-input-block">
								<input type="text" name="empNo" autocomplete="off" value="<%=request.getParameter("empNo")%>"
									class="layui-input" id="empNo" readonly>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>员工名
							</label>
							<div class="layui-input-block">
								<input type="text" name="empName" autocomplete="off" value="<%=request.getParameter("empName")%>"
									class="layui-input" id="empName" readonly>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>用户名
							</label>
							<div class="layui-input-block">
								<input type="text" name="userName" autocomplete="off" value="<%=request.getParameter("userName")%>"
									class="layui-input" id="userName">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"> <span class='x-red'>*</span>用户密码
							</label>
							<div class="layui-input-block">
								<input type="text" name="userPwd" autocomplete="off" value="<%=request.getParameter("userPwd")%>"
									class="layui-input" id="userPwd">
							</div>
						</div>
						<div class="layui-form-item">
							<button class="layui-btn" type="button" lay-filter="*" lay-submit="" id="submit"">保存</button>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<script src="js/jquery-2.0.3.js" charset="utf-8"></script>
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script src="./js/x-layui.js" charset="utf-8"></script>
	<script type="text/javascript">
	</script>
	<script>
		layui.use(['element','layer','form'], function(){
            lement = layui.element();//面包导航
            layer = layui.layer;//弹出层
            form = layui.form();
          //监听提交
            form.on('submit(*)', function(data){
            	var userNo = $("input[name = 'userNo']").val();
            	var empNo = $("input[name = 'empNo']").val();
            	var userName = $("input[name = 'userName']").val();
            	var userPwd = $("input[name = 'userPwd']").val();
            	
            	$.ajax({
            		type : "post",
            		url : "UsersServlet",
            		data : {
            			userNo : userNo,
            			empNo : empNo,
            			userName : userName,
            			userPwd : userPwd,
            			op : "updUser"
            		},success:function (data) {
                        if(data == "修改成功" ){
                            layer.msg(data,{icon:6,time:1000});
                            setTimeout(function(){
                                window.parent.location.reload();
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            },1000);
                            return false;
                        }else{
                            layer.msg(data,{icon:5,time:2000});return false;
                        }
                    },
                    dataType:"json"
                });
                return false;
            })
            
		})
	      
	</script>

</body>
</html>